#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPixmap>

#include <QImage>
#include <QTime>
#include <QFileDialog>
#include <QMouseEvent>
#include "resizeui.h"

#include <iostream>
using namespace std;

typedef struct{
    int choice;
    int dx;
    int dy;
}BtnInfo;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void resizeEvent(QResizeEvent *event);
    ResizeUI resizeUi;


    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);


    int findCombinePlace();

    int getEndPlace(int startH);

    bool isSameLine(QImage img1, QImage img2, int h1, int h2);

    void showImage(QImage img, int label);


private slots:
    void on_pushButton_3_clicked();

    void on_btnH_clicked();

    void on_btnW_clicked();

    void on_btn1_clicked();

    void on_btn2_clicked();

    void on_btn3_clicked();

    void on_btn4_clicked();

    void on_btn6_clicked();

    void on_btn5_clicked();

    void on_btn7_clicked();

private:
    Ui::MainWindow *ui;

    QImage image1,image2;
    QImage image1_show,image2_show;

    int ignoreH=0;
    int ignoreW=0;

    int max_dis=50;
    int overlap=10;

    BtnInfo btnInfo;
};




#endif // MAINWINDOW_H
